@include('admin.header')
<style>
  .search_product {
    max-height:248px;
    overflow-y: scroll;
  }
  .search_product > .item {
    width:80px;
    margin-right:5px;
    float:left;
  }
  .search_product > .item img {
    height:80px;
  }
  .search_product > .item .name {
    height:20px;
    overflow:hidden;
  }

  .order_info {
    display: block;
    margin-top: 5px;
  }
</style>
<div class="margin-top-20">
  <form method="post" class="form-horizontal js-ajax-form direct_order_edit_form" action="/globalexchange/direct_order_edit" novalidate="novalidate" enctype ="multipart/form-data">
    <fieldset>
      <div class="control-group"><label class="control-label">订单编号</label>
        <div class="controls">
          <span class="order_info">{{$data->order_no or ''}}</span>
        </div>
      </div>
      <div class="control-group"><label class="control-label">所属用户</label>
        <div class="controls">
          <span class="order_info">{{$data->nodename or ''}}</span>
        </div>
      </div>
      <div class="control-group"><label class="control-label">手机号码</label>
        <div class="controls">
          <span class="order_info">{{$data->mobileno or ''}}</span>
        </div>
      </div>
      <div class="control-group"><label class="control-label">所属直销套餐</label>
        <div class="controls">
          <span class="order_info">{{$data->direct_name or ''}}</span>
        </div>
      </div>
      <div class="control-group"><label class="control-label">所属系统套餐</label>
        <div class="controls">
          <span class="order_info">{{$data->product_group_name or ''}}</span>
        </div>
      </div>
      <div class="control-group"><label class="control-label">订单总价格</label>
        <div class="controls">
          <span class="order_info">{{$data->amount or ''}}</span>
        </div>
      </div>
      <div class="control-group"><label class="control-label">邮费</label>
        <div class="controls">
          <span class="order_info">{{$data->postage or '包邮'}}</span>
        </div>
      </div>
      <div class="control-group"><label class="control-label">订单状态</label>
        <div class="controls">
          <span class="order_info">已付款</span>
        </div>
      </div>
      <div class="control-group"><label class="control-label">下单时间</label>
        <div class="controls">
          <span class="order_info">{{$data->create_time or ''}}</span>
        </div>
      </div>
      <div class="control-group"><label class="control-label">支付详情</label>
        <div class="controls">
        @foreach($data->pay_detail as $key => $value)
          <span class="order_info">{{$value['Remarks']}}::{{$value['PayAmount']}}</span>
        @endforeach
        </div>
      </div>
      <div class="control-group"><label class="control-label">系统套餐订单编号</label>
        <div class="controls">
          <span class="order_info">{{$data->order_no_group}}</span>
        </div>
      </div>
      <div class="control-group"><label class="control-label">第三方平台网址</label>
        <div class="controls">
          <input type="text" name="third_url" value="{{$data->third_url or ''}}">
        </div>
      </div>
      <div class="control-group"><label class="control-label">第三方登录名</label>
        <div class="controls">
          <input type="text" name="third_name" value="{{$data->third_name or ''}}">
        </div>
      </div>
      <div class="control-group"><label class="control-label">第三方登录密码</label>
        <div class="controls">
          <input type="text" name="third_password" value="{{$data->third_password or ''}}">
        </div>
      </div>
    </fieldset>
    <!-- 直销订单ID号 -->
    <input type="hidden" name="id" value="{{$data->id or 0}}" />
    <div class="form-actions">
      <input type="hidden" name="id" value="{{$data->id or 0}}" />
      <button type="submit" class="btn btn-primary js-ajax-submit">保存</button></div>
  </form>
</div>

<script>
	$(function () {
		$('.direct_order_edit_form').submit(function(){
			var $t = $(this),action=$t.attr('action'),data = $t.serialize();
			post(action,data,function(data){
				_alert('处理成功',function(){
					parent.location.reload();
					parent.layer.close(parent.layer_open2);
        });
      });
			return false;
    });
	});
	
	function product_add(product_id){
		var $t = $('[name=product_id]'),val = $t.val(),vals = val.split(',');
		product_id = product_id + '';
		if(vals.length == 1){
			if(vals[0] == '')
			  vals = [];
        }
		if($.inArray(product_id,vals) === -1){
			vals.push(product_id);
			val = vals.join(',');
        }
		$t.val(val);
    }
</script>